package cn.bugstack.domain.activity.service.trial.factory;


import cn.bugstack.domain.activity.model.entity.MarketProductEntity;
import cn.bugstack.domain.activity.model.entity.TrialBalanceEntity;
import cn.bugstack.domain.activity.model.valobj.GroupBuyActivityDiscountVO;
import cn.bugstack.domain.activity.model.valobj.SkuVO;
import cn.bugstack.domain.activity.service.trial.node.RootNode;
import cn.bugstack.types.design.framework.tree.StrategyHandler;
import lombok.*;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;

/**
 * @author 丨一
 * @version 1.0
 * @title DefaultActivityStrategyFactory
 * @description:
 * @date 2025/7/25 下午5:51
 */
@Service
@RequiredArgsConstructor
public class DefaultActivityStrategyFactory {

    private final RootNode rootNode;

    public StrategyHandler<MarketProductEntity, DefaultActivityStrategyFactory.DynamicContext, TrialBalanceEntity> strategyHandler() {
        return rootNode;
    }


    @Data
    @Builder
    @AllArgsConstructor
    @NoArgsConstructor
    public static class DynamicContext {
        //动态上下文
        private GroupBuyActivityDiscountVO groupBuyActivityDiscountVO;

        private SkuVO skuVO;

        private BigDecimal deductionPrice;
    }
}
